/*
 * @Author: YNT 2501512800@qq.com
 * @Date: 2022-06-19 15:06:46
 * @LastEditors: YNT 2501512800@qq.com
 * @LastEditTime: 2022-09-21 15:10:47
 * @FilePath: \智慧社区的副本\src\api\modules\neighbor-knowledge.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export default class {
  //#region 达人分区
  getTalentCategoryList(params) {
    return this.request({
      url: "/api/admin/talent_category/",
      method: "GET",
      params,
    });
  }
  addTalentCategory(data) {
    return this.request({
      url: `/api/admin/talent_category/`,
      method: "POST",
      data,
    });
  }
  editTalentCategory(id, data) {
    return this.request({
      url: `/api/admin/talent_category/${id}`,
      method: "PUT",
      data,
    });
  }
  delTalentCategory(id) {
    return this.request({
      url: `/api/admin/talent_category/${id}`,
      method: "DELETE",
    });
  }
  //#endregion

  //#region 社区达人

  // 达人分类列表
  getTalentTypeList() {
    return this.request({
      url: "/admin/v1/talent/type",
      method: "GET",
    });
  }

  addTalentType(data) {
    return this.request({
      url: `/admin/v1/talent/type`,
      method: "PUT",
      data,
    });
  }

  editTalentType(id, data) {
    return this.request({
      url: `/admin/v1/talent/type?id=${id}`,
      method: "POST",
      data,
    });
  }

  deleteTalentType(id) {
    return this.request({
      url: `/admin/v1/talent/type?id=${id}`,
      method: "DELETE",
    });
  }

  // 达人列表
  getTalentList(params) {
    return this.request({
      url: `/admin/v1/talent/user/list`,
      method: "GET",
      params,
    });
  }

  addTalent(data) {
    return this.request({
      url: `/admin/v1/talent/user`,
      method: "PUT",
      data,
    });
  }
  editTalent(id, data) {
    return this.request({
      url: `/admin/v1/talent/user?id=${id}`,
      method: "POST",
      data,
    });
  }
  delTalent(id) {
    return this.request({
      url: `/admin/v1/talent/user?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
}
